package com.commonlib.downloadmgr.db;

import android.content.Context;

import com.commonlib.downloadmgr.base.DatabaseBuilder;
import com.commonlib.downloadmgr.base.DownloadBaseHelper;
import com.commonlib.downloadmgr.entity.Entity;
import com.commonlib.downloadmgr.subclass.DownloadHelper;
import com.commonlib.downloadmgr.subclass.DownloadJob;

/**
 * Database implementation using Android SQLite
 * 
 * @author Lukasz Wisniewski
 */
public class EntityDatabaseBuilder extends DatabaseBuilder<Entity> {
//	private static final String TAG = DatabaseImplEntity.class.getSimpleName();
	private static final String DB_NAME = "db_downloadmgr";
	private static final String TABLE_NAME = "table_jobs_entity";
	private static EntityDatabaseBuilder self;

	public static EntityDatabaseBuilder getInstance(Context context){
		if (self == null) {
			self = new EntityDatabaseBuilder(context);
		}
		return self;
	}
	
	protected EntityDatabaseBuilder(Context context){
		super(context, DownloadJob.class, Entity.class, DB_NAME, TABLE_NAME, 4);
	}

	@Override
	protected DownloadBaseHelper<Entity> getDownloadHelper() {
		return DownloadHelper.getInstance();
	}

}
